<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title>${title}</title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/am.reference.ftl" />
	</head>
	<body class="${configs["skinName"]}">
		<div class="page-content">
			<div class="row">
			<#if viewMode !="view">
			<#include "common/breadcrumb.ftl">
			</#if>
				<form id="form" role="form" class="form-horizontal" method="post" action="${base}/${form_action}">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-body">
								<input type="hidden" name="helpId" id="helpId" value="${model.helpId}" <#if viewMode == "view">disabled</#if>>
								<#if viewMode == "view">
								<div class="widget-header widget-header-flat">
									<h5 class="lighter">
										${module}
									</h5>
								</div>
								<#else>
								<div class="alert alert-warning">
									<strong>提示!</strong>
									<strong style="color:#dd514c;">出现红框</strong>的表示不能为空
								</div>
								</#if>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										帮助分类
									</label>
									<div class="col-sm-6">
										<select id="helpType" name="helpType" class="select-chosen form-control" required <#if viewMode == "view">disabled</#if> >
											<option value="">请选择分类</option>
										<#if typeList?exists && typeList?size gt 0>
										<#list typeList as item>
											<option value="${item.dataValue}" <#if item.dataValue == model.helpType>selected="selected"</#if> >${item.dataName}</option>
										</#list>
										</#if>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										标题
									</label>
									<div class="col-sm-6">
										<input type="text" id="title" name="title" value="${model.title}" class="form-control" required placeholder="请输入标题" <#if viewMode == "view">disabled</#if>>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										适用平台
									</label>
									<div class="col-sm-6">
										<select multiple="multiple" name="platform" class="select-chosen form-control" required <#if viewMode == "view">disabled</#if> data-placeholder="请选择平台">
										<#list platforms as platform >
											<#if platform.platformName?lower_case?contains('ios') || 
												 platform.platformName?lower_case?contains('android') ||
												 platform.platformName?lower_case?contains('苹果') ||
												 platform.platformName?lower_case?contains('安卓')>
											<option value="${platform.platformValue}" <#if (!model.platform?contains(',') && model.platform == platform.platformValue) || model.platform?contains('${platform.platformValue},')  || model.platform?contains(',${platform.platformValue}') >selected="selected"</#if> >${platform.platformName}</option>
											</#if>
										</#list>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										帮助内容
									</label>
									<div class="col-sm-6">
										<#assign editorName="content">
										<#assign editorValue="${model.content}">
										<#include "common/froalaeditor.ftl" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right">
										是否启用
									</label>
									<div class="col-sm-6">
										<input class="ace ace-switch ace-switch-7" type="checkbox" name="enabled" <#if model == null || model.enabled>checked="checked"</#if> <#if viewMode == "view">disabled</#if>>
										<span class="lbl"></span>
									</div>
								</div>
								<#if viewMode != "view">
								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9">
										<button id="btnSubmit" class="btn btn-info" type="submit">
											<i class="fa fa-check bigger-110"></i>
											提 交
										</button>
									</div>
								</div>
								</#if>
							</div>
						</div>
					</div>
				</form>
			</div>	
		</div>
		<script type="text/javascript">
		$(function(){
			$('.select-chosen').chosen();
			$('#form').validator();
		})
		</script>
	</body>
</html>